package com.situ.supermarket.controller;

import com.situ.supermarket.entity.Area;
import com.situ.supermarket.entity.Employee;
import com.situ.supermarket.service.EmployeeService;
import com.situ.supermarket.service.impl.EmployeeServiceImpl;
import com.situ.supermarket.vo.ResultVO;
import com.situ.supermarket.vo.TableVO;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet("/employee")
public class EmployeeController extends BaseController{
    EmployeeService service = new EmployeeServiceImpl();

    public void page(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.getRequestDispatcher("/WEB-INF/employee.jsp").forward(request,response);
    }
    public TableVO select(Integer page, Integer limit, String name) {
        return service.select(page,limit,name);
    }
    public void save(Employee e){
        service.save(e);
    }
    public ResultVO delete(Integer id){
        return service.delete(id);
    }

    public Employee info(Integer id) {
        return service.info(id);
    }
    public List<Employee> all(){
        return service.all();
    }
}
